home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / lisp / stk-3.002 / stk-3 / STk-3.1 / Demos / Widget / Wradio.stklos < prev    next >
Encoding:
Text File  |  1995-08-23  |  1.5 KB  |  47 lines

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;;;
  3. ;;;; STk adaptation of the Tk widget demo.
  4. ;;;;
  5. ;;;; This demonstration script creates a toplevel window containing
  6. ;;;; several  radiobutton widgets.
  7. ;;;;
  8. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  9.  
  10. (require "Button")
  11.  
  12. (define (demo-radio)
  13.   (let* ((w      (make-demo-toplevel "radio"
  14.                      "Radiobutton Demonstration"
  15.                      "Two groups of radiobuttons are displayed below.  If you click on a button then the button will become selected exclusively among all the buttons in its group.  A Tcl variable is associated with each group to indicate which of the group's buttons is selected.  Click the \"See Variables\" button to see the current values of the variables."
  16.                      'radio-size 'radio-color))
  17.      (radios (make <Frame> :parent w))
  18.      (left   (make <Frame> :parent radios))
  19.      (right  (make <Frame> :parent radios)))
  20.  
  21.     ;; Create radiobuttons
  22.     (for-each (lambda (pt)
  23.             (pack (make <Radio-button>
  24.                 :parent left
  25.                 :text (format #f "Point Size ~A" pt)
  26.                 :variable 'radio-size
  27.                 :relief "flat"
  28.                 :width 15
  29.                 :anchor "w"
  30.                 :value pt)))
  31.           '(10 12 18 24))
  32.     
  33.     (for-each (lambda (color)
  34.             (pack (make <Radio-button>
  35.                 :parent right
  36.                 :text color 
  37.                 :variable 'radio-color
  38.                 :relief "flat"
  39.                 :width 15
  40.                 :anchor "w"
  41.                 :value color)))
  42.           '("Red" "Green" "Blue" "Yellow" "Orange" "Purple"))
  43.     
  44.     (pack left right :side "left" :expand #f :pady ".5c" :padx ".5c")
  45.     (pack radios)))
  46.  
  47.